//
// Created by zhouyi on 2019/11/13.
//

#include <cstdio>
#include "CppDemo02.h"

using namespace std;

class A {
public:
    int ma;

    A(int c) {
        ma = c;
        printf("构造函数A\n");
    }

    ~A() {
        printf("析构函数~A\n");
    }

private:

};

class B {
public:
    A classA;

    B() : classA(122) {

    }

    B(const A &classA) : classA(classA) {

    }

private:
    int mb;
};

int main(int argc, char *argv[]) {

    B b;
    printf("%d\n", b.classA.ma);

    B b1(A(123));
    printf("%d\n", b1.classA.ma);

    int a(12);
    float ff(1.14);
    float ff2(1.18);
    return 0;
}
